feat: global layer exclusivity #1249
Draft
+149
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Theoretically, this change should be rather straightforward, as it is mostly about the behaviour exhibited by the checkbox, which is easy to untoggle in the layer click handler inside
input-click.js
. However, only part of the functionality can be implemented there, as there are inconsistencies in the radio buttons when they first load, causing multiple of them to be selected simultaneously:In order to mitigate this, I had planned to modify the initialization procedure of the Layer Control so that it manually selects one of the radio buttons, deselecting all others. And while this works in theory, the
first-update.js
handler seems to run just a smidge too early for the layer list to be available. A second or two later, or even just 200ms always work.This can be hackily implemented using a
setTimeout
call, but it seems to me what I am actually looking for is some kind ofnextTick
function that is commonly used in Vue to solve this problem.Implemented changes
Screenshots/Videos
Checklist before requesting a review